package com.ctshk.rpc.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.goods.entity.CommoditySalesArea;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 商品销售区域 Mapper 接口
 * </p>
 *
 * @author 姜斌文
 * @since 2021-04-13
 */
public interface CommoditySalesAreaMapper extends BaseMapper<CommoditySalesArea> {
    @Select("select " +
            "id, commodity_id as commodityId, area_type as areaType, commodity_attribute_id as commodityAttributeId " +
            "from t_commodity_sales_area where commodity_id = #{commodityId}")
    List<CommoditySalesArea> findCommoditySalesAreaByCommodityId(@Param("commodityId") Long commodityId);
}
